<?php if (!defined('THINK_PATH')) exit();?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>exam system</title>
<link rel="shortcut icon" href="/html/images/favicon.ico" type="image/x-icon">
<link rel="stylesheet" type="text/css" href="/Public/Home/css/global.css" />
<link rel="stylesheet" type="text/css" href="/Public/Home/css/manage.css" />
</head>
<body class="global_table global_form global_icon global_formList">
<div class="global_head">
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
</head>
<div class="inner">
            <!-- <div class="logo" onclick="window.location.href='/';" id="busi_move">
                <img src="/html/images/global_logo.png" alt="活动树"
                    id="huodongshu_logo" style="">
            </div> -->
            <div class="nav">
                <ul>
                    <li id="id_li_event"><a href="<?php echo U('/Home/index');?>">首页</a></li>
                    <li id="id_li_myevent" class="choose"><a href="<?php echo U('/Home/index/choosePaper');?>">在线答题</a></li>
                    <li id="id_li_account"><a href="<?php echo U('/Home/index/account');?>">个人中心</a></li>
                </ul>
            </div>
            <ul class="login" id="changeclass">
            <?php if($loginName != ''): ?><li><span id="huodongshu_welcome_span"><?php echo ($loginName); ?></span>
                    <a href="<?php echo U('/Home/Check/loginOut',array('from'=>'index'));?>"> | 退出</a>
                </li>
            <?php else: ?>
                 <li class="">
                    <a id="huodongshu_login" href="<?php echo U('/Home/Check/login',array('from'=>'index'));?>">登录 | </a>
                    <a id="huodongshu_register" href="/html/register.html">注册</a>
                </li><?php endif; ?>
            </ul>
</div>
</div>

<div class="global_width">
            <div class="global_leftMenu">
                <div class="menuTitle">
                    <span class="icon icon01"></span>我的账户
                </div>
                <div class="menuBody">
                    <dl>
                        <dt class="">
                            <span class="icon menu01"></span> <a
                                href="<?php echo U('account');?>">基本信息</a> <span
                                class="arrow"></span>
                        </dt>
                        <dt class="last choose">
                            <span class="icon menu01"></span> <a
                                href="<?php echo U('results');?>">成绩查询</a> <span class="arrow"></span>
                        </dt>
                    </dl>
                </div>
            </div>
            <div class="global_right">
        <div class="rightTitle font_green01"><em class="line"></em>成绩列表</div>
        <div class="rightBody">
            <div class="manage_main manage_orderM">
            <!-- <div class="namage_export">
                    <a class="btn_small btn_gray btn_90x30" href="javascript:void(0)" onclick="manage_order_obj.output()">导出</a>
                    <p class="tips">可结款总金额，不包含主办方手动添加、主办方excel导入的订单金额，请知晓。</p>
                    <div class="clear"></div>
             </div> -->
            <div class="manage_tableOuter">
                <table style="width:920px;">
                    <thead>
                        <tr>
                            <!-- <th width="50"><input name="" type="checkbox" value="" class="checkbox" /></th> -->
                            <th width="150">试卷名称</th>
                            <th width="100">分数</th>
                            <th width="100">答题时间</th>
                            <th width="50">操作</th>
                        </tr>
                    </thead>
                    <tbody>
                    <?php if(count($result['info']) > 0): if(is_array($result['info'])): foreach($result['info'] as $key=>$list): ?><tr>
                            <td><?php echo ($list['name']); ?></td>
                            <td><?php echo ($list['score']); ?></td>
                            <td><?php echo ($list['created_time']); ?></td>
                            <td class="operate">
                                <a href="javascript:;" class="icon10" title="查看" onclick="showDetails(<?php echo ($list['id']); ?>);"><span></span></a>
                            </td>
                        </tr><?php endforeach; endif; ?>
                        <?php else: endif; ?>
                    </tbody>
                    <thead class="tFooter">
                        <tr>
                            <th colspan="10">
                                共<?php echo ($result['num']); ?>条记录
                            </th>
                        </tr>
                    </thead> 
                </table>
            </div>
            <div class="global_page">
                <dl>
                    <dt><a href="javascript:void(0);" onclick="getMenuByPage(1);">首页</a></dt>
                    <dt><a href="javascript:void(0);" onclick="getMenuByPage(<?php echo ($result['prePage']); ?>);">前页</a></dt>
                    <?php $__FOR_START_20501__=0;$__FOR_END_20501__=$result['page'];for($i=$__FOR_START_20501__;$i < $__FOR_END_20501__;$i+=1){ if($i+1 == $result['curPage']): ?><dd><a class="choose" href="javascript:void(0);" onclick="getMenuByPage(<?php echo ($i+1); ?>);"><?php echo ($i+1); ?></a></dd>
                    <?php else: ?>
                        <dd><a href="javascript:void(0);" onclick="getMenuByPage(<?php echo ($i+1); ?>);"><?php echo ($i+1); ?></a></dd><?php endif; } ?>
                    <dt><a href="javascript:void(0);" onclick="getMenuByPage(<?php echo ($result['nextPage']); ?>);">后页</a></dt>
                    <dt><a href="javascript:void(0);" onclick="getMenuByPage(<?php echo ($result['page']); ?>);">末页</a></dt>
                    <dt><span>共<?php echo ($result['page']); ?>页</span></dt>
                </dl>
            </div>
        </div>
        </div>
    </div>
    <div class="clear"></div>
<div class="clear"></div></div>

<script src="/Public/Static/jquery-1.9.1.min.js"></script>
<script src="/Public/Home/js/aaa.js"></script>

<script>
function getMenuByPage(page) {
    $.post("<?php echo U('results');?>",{'page':page},function(msg){
        if(msg && msg != 0) {
        	showResults(msg);
        } else {
        	showResults();
        } 
    });
}

function showResults(obj) {
	var html = '',bottom = '';
    if (obj) {
        $.each(obj['info'],function(idx,record){
            html += '<tr><td>'+record['name']+'</td>\
                     <td>'+record['score']+'</td>\
                     <td>'+record['created_time']+'</td>\
                     <td class="operate">\
                     <a href="javascript:;" class="icon10" title="查看"><span></span></a>\
                     </td></tr>';
        });
    } else {
        html += '<tr class="noDate"><td colspan="4">暂无数据</td></tr>';
    }
    bottom += '<dl>\
        <dt><a href="javascript:void(0);" onclick="getMenuByPage(1);">首页</a></dt>\
        <dt><a href="javascript:void(0);" onclick="getMenuByPage('+obj['prePage']+');">前页</a></dt>';
    for(var i=0;i<obj['page'];i++) {
        var choose = '';
        if ((parseInt(i)+1) == obj['curPage']) {
            choose = 'choose';
        }
        bottom += '<dd><a class="'+choose+'" href="javascript:void(0);" onclick="getMenuByPage('+(parseInt(i)+1)+');">'+(parseInt(i)+1)+'</a></dd>';
    }
     bottom += '<dt><a href="javascript:void(0);" onclick="getMenuByPage('+obj['nextPage']+');">后页</a></dt>\
     <dt><a href="javascript:void(0);" onclick="getMenuByPage('+obj['page']+');">末页</a></dt>\
     <dt><span>共'+obj['page']+'页</span></dt>\
     </dl>';
    $("tbody").html(html);
    $(".global_page").html(bottom);
}

function showDetails(id) {
	location.href = "index.php?s=Home/index/details&paperId="+id;
}
</script>
</body>
</html>